﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OpenPop.Pop3;
using OpenPop.Mime;
using System.Data;
using System.Threading;
using System.Globalization;
public partial class Inbox : System.Web.UI.Page
{
 
 mypopclient pop3Client;

    protected void Page_Load(object sender, EventArgs e)
    {
        pop3Client = new mypopclient();
        pop3Client.Connect();
        if (!Page.IsPostBack)
        {
            
           
            GridView gvr = (GridView)ReadMail1.FindControl("gvEmails");
            // Session["messagetable"] = dtMessages;
            gvr.DataSource = pop3Client.GetAllMesseges();
            gvr.DataBind();
            ReadMail1.Visible = true;
            //pop3Client.Disconnect();
        }
    }

   
    protected override void InitializeCulture()
    {
        if (Session["CurrentCulture"] != null)
        {
            string lang = Session["CurrentCulture"].ToString();
            if (lang != null && lang != "")
            {
                Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang);
                Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(lang);
                Thread.CurrentThread.CurrentCulture.DateTimeFormat = new CultureInfo("en-US", false).DateTimeFormat;



            }
        }

    }

}
